1
|
|
|
|
2
|
|
|
var growl = require('./lib/growl') |
3
|
|
|
|
4
|
|
|
growl('Support sound notifications', {title: 'Make a sound', sound: 'purr'}); |
5
|
|
|
growl('You have mail!') |
6
|
|
|
growl('5 new messages', { sticky: true }) |
7
|
|
|
growl('5 new emails', { title: 'Email Client', image: 'Safari', sticky: true }) |
8
|
|
|
growl('Message with title', { title: 'Title'}) |
9
|
|
|
growl('Set priority', { priority: 2 }) |
10
|
|
|
growl('Show Safari icon', { image: 'Safari' }) |
11
|
|
|
growl('Show icon', { image: 'path/to/icon.icns' }) |
12
|
|
|
growl('Show image', { image: 'path/to/my.image.png' }) |
13
|
|
|
growl('Show png filesystem icon', { image: 'png' }) |
14
|
|
|
growl('Show pdf filesystem icon', { image: 'article.pdf' }) |
15
|
|
|
growl('Show pdf filesystem icon', { image: 'article.pdf' }, function(){ |
16
|
|
|
console.log('callback'); |
|
|
|
|
17
|
|
|
}) |
18
|
|
|
growl('Show pdf filesystem icon', { title: 'Use show()', image: 'article.pdf' }) |
19
|
|
|
growl('here \' are \n some \\ characters that " need escaping', {}, function(error, stdout, stderr) { |
20
|
|
|
if (error !== null) throw new Error('escaping failed:\n' + stdout + stderr); |
|
|
|
|
21
|
|
|
}) |
22
|
|
|
growl('Allow custom notifiers', { exec: 'echo XXX %s' }, function(error, stdout, stderr) { |
|
|
|
|
23
|
|
|
console.log(stdout); |
|
|
|
|
24
|
|
|
}) |
25
|
|
|
growl('Allow custom notifiers', { title: 'test', exec: 'echo YYY' }, function(error, stdout, stderr) { |
|
|
|
|
26
|
|
|
console.log(stdout); |
|
|
|
|
27
|
|
|
}) |
28
|
|
|
growl('Allow custom notifiers', { title: 'test', exec: 'echo ZZZ %s' }, function(error, stdout, stderr) { |
|
|
|
|
29
|
|
|
console.log(stdout); |
|
|
|
|
30
|
|
|
}) |
31
|
|
|
growl('Open a URL', { url: 'https://npmjs.org/package/growl' }); |
32
|
|
|
|